<!--
 * @Author: your name
 * @Date: 2019-09-21 23:45:06
 * @LastEditTime: 2020-12-31 22:55:11
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /renwu-vue/src/baseUI/authButton/index.vue
-->
<template>
  <div class="auth-button" @click.stop="handleClick">
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    autoCall: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleClick() {
      if (this.$store.state.user.userInfo) {
        this.$emit('onLogin')
      } else {
        this.$store.dispatch('user/showLoginPop')
      }
    }
  }
}
</script>
